﻿using System;
using Zinnia.Lite.Core;
using Zinnia.Lite.Core.Imp;

namespace Zinnia.Lite.Untilty
{
    /// <summary>
    /// Des加密帮助类
    /// </summary>
    public sealed class DesEncryptHelper
    {
        private IEncryptService encryptService = null;
        private DesEncryptHelper()
        {
            encryptService = new DesEncryptService();
        }
        public static DesEncryptHelper Instance => new DesEncryptHelper();

        /// <summary>
        /// 加密
        /// </summary>
        /// <param name="text"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        public string Encrypt(string text, string key = "zinnia,!#@")
        {
            return encryptService.Encrypt(text, key);
        }

        /// <summary>
        /// 解密
        /// </summary>
        /// <param name="text"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        public string Decrypt(string text, string key = "b631b292")
        {
            return encryptService.Decrypt(text, key);
        }
    }
}
